import { useContext } from 'react'

import { View } from '@tarojs/components'

import { Dialog } from '@antmjs/vantui'

import { LoginContext } from '../../Context'

const LoginConfirmDialog = () => {
	const { confirmDilogVisible, closeConfirmfDialog, toggleAgree } =
		useContext(LoginContext)
	return (
		<Dialog
			title='温馨提示'
			showCancelButton
			show={confirmDilogVisible}
			cancelButtonText='不同意'
			confirmButtonText='同意'
			onCancel={closeConfirmfDialog}
			onConfirm={() => {
				toggleAgree()
				closeConfirmfDialog()
			}}
		>
			<View style={{ padding: '12px', paddingBlockStart: 'unset' }}>
				为了更好地保障您的合法权益，并完整地体验平台的功能服务，请您阅读并同意下方的
				<text style={{ color: 'blue' }}>《用户协议》</text>
			</View>
		</Dialog>
	)
}
export default LoginConfirmDialog
